package cn.ljy.uem.web.action.backstage.school;

import cn.ljy.authority.web.controller.backstage.BaseBackstageController;
import cn.ljy.common.model.result.ResponseData;
import cn.ljy.uem.model.SchoolClassRoom;
import cn.ljy.uem.model.query.SchoolClassRoomQuery;
import cn.ljy.uem.service.SchoolClassRoomService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;

/**
 * 学校教室控制器
 *
 * @author 凡渊
 * @date 2022/07/18 10:28:52
 */
@Api(tags = "后台的教室模块")
@RestController
@RequestMapping(value = "/api/backstage/school/schoolclassroom")
public class SchoolClassRoomController extends BaseBackstageController<SchoolClassRoom, SchoolClassRoomQuery, Integer> {
    @Autowired
    private SchoolClassRoomService baseService;

    @ApiOperation(value = "查询所有教室")
    @GetMapping("/all")
    @Override
    protected ResponseData query(SchoolClassRoomQuery query) {
        return super.query(query);
    }

    @ApiOperation(value = "读取教室信息")
    @Override
    protected ResponseData get(@PathVariable("id") Integer id) {
        return super.get(id);
    }

    @ApiOperation(value = "分页查询教室列表")
    @Override
    protected ResponseData query(Integer page, Integer pageSize, SchoolClassRoomQuery query) {
        return super.query(page, pageSize, query);
    }

    @ApiOperation(value = "添加教室")
    @Override
    protected ResponseData add(@Valid @RequestBody SchoolClassRoom SchoolClassRoom) {
        return super.add(SchoolClassRoom);
    }

    @ApiOperation(value = "批量删除指定的多个教室")
    @Override
    protected ResponseData deletes(@NotEmpty(message = "操作失败：请选择要移除的记录") Integer[] ids) {
        return super.deletes(ids);
    }

    @ApiOperation(value = "编辑教室")
    @Override
    protected ResponseData edit(@Valid @RequestBody SchoolClassRoom SchoolClassRoom) {
        return super.edit(SchoolClassRoom);
    }

}
